import 'package:alice_screen/util/i18n/localizations.dart';
import 'package:alice_screen/widgets/load_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class GuideDownload extends StatelessWidget {
  const GuideDownload({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: <Widget>[
          SizedBox(width: ScreenUtil().setWidth(128.0),),
          qrCode(),
          SizedBox(width: ScreenUtil().setWidth(66.0),),
          Text(MyLocalizations.of(context).scanToDownloadApp,
            style: TextStyle(
              color: Colors.white,
              fontSize: ScreenUtil().setSp(44.0),
              fontWeight: FontWeight.w500
            ),
          )
        ],
      )
    );
  }

  Widget qrCode() {
    return Container(
      alignment: Alignment.center,
      width: ScreenUtil().setWidth(280.0),
      height: ScreenUtil().setHeight(280.0),
      decoration: BoxDecoration(
        color: Color(0x56121C38),
        borderRadius: BorderRadius.circular(4),
        border: Border.all(color: Color(0x56FFFFFF), width: 2)
      ),
      child: Container(
        alignment: Alignment.center,
        width: ScreenUtil().setWidth(230.0),
        height: ScreenUtil().setHeight(230.0),
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(4)
        ),
        child: LoadAssetImage('guide/app_download_qrcode',
          width: ScreenUtil().setWidth(214.0),
          height: ScreenUtil().setHeight(214.0),
          fit: BoxFit.fill,
        ),
      ),
    );
  }
}